#!/bin/bash

read -p "是否在/media/datas挂载外部硬盘[y/n]: " ENABLE_MOUNT
if [ "$ENABLE_MOUNT" != "y" ]; then
    exit 0
fi

while true;
do
    read -p "请输入硬盘分区的UUID（区分大小写）: " UUID
    if [ ! -z $UUID ]; then
        break
    fi
done

echo "UUID=$UUID /media/datas ext4 defaults 0 0" | sudo tee -a /etc/fstab
